package com.synnex.mobile.servier.core.notification.bo;

import com.synnex.mobile.generic.core.util.ObjectUtil;
import com.synnex.mobile.servier.core.notification.dto.DeviceToken;
import com.synnex.mobile.servier.core.notification.dto.Notification;
import org.apache.commons.httpclient.util.DateUtil;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: kerryf
 * To change this template use File | Settings | File Templates.
 */
public class NotificationBo  implements Serializable {

    protected Integer id;
    protected String msg;
    protected String picPath;
    protected String title;
    protected Date planSendTime ;
    protected Date actualSendTime;
    protected String sendNow;

    private String entryDate;
    private Date entryD;

    private String updateDate;


    public static NotificationBo createInstance(Notification notification) {
        NotificationBo notificationBo = ObjectUtil.copyProperties(notification, NotificationBo.class);
        notificationBo.setEntryDate(DateUtil.formatDate(notification.getEntryDate(), "yyyy-MM-dd HH:mm:ss"));
        notificationBo.setEntryD(notification.getEntryDate());
        return notificationBo;
    }

    public static List<NotificationBo> createListInstances(List<Notification> notifications) {
        List<NotificationBo> notificationBos = new ArrayList<NotificationBo>();
        if (notifications != null) {
            for (Notification notification : notifications) {
                notificationBos.add(createInstance(notification));
            }
        }
        return notificationBos;
    }

    public String getEntryDate() {
        return entryDate;
    }

    public void setEntryDate(String entryDate) {
        this.entryDate = entryDate;
    }

    public String getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getPicPath() {
        return picPath;
    }

    public void setPicPath(String picPath) {
        this.picPath = picPath;
    }

    public Date getEntryD() {
        return entryD;
    }

    public void setEntryD(Date entryD) {
        this.entryD = entryD;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getPlanSendTime() {
        return planSendTime;
    }

    public void setPlanSendTime(Date planSendTime) {
        this.planSendTime = planSendTime;
    }

    public Date getActualSendTime() {
        return actualSendTime;
    }

    public void setActualSendTime(Date actualSendTime) {
        this.actualSendTime = actualSendTime;
    }

    public String getSendNow() {
        return sendNow;
    }

    public void setSendNow(String sendNow) {
        this.sendNow = sendNow;
    }
}
